#!/bin/sh
# Job yaml can send below ENVIRONMENT VARIABLES to me
# - test
# - testcase
# END ENVIRONMENT VARIABLES

## The LTP testsuite contains a collection of tools for
## testing the Linux kernel and related features.

. $LKP_SRC/lib/env.sh
. $LKP_SRC/lib/upload.sh
. $LKP_SRC/lib/tests/ltp.sh
. $LKP_SRC/lib/reproduce-log.sh

cd $BENCHMARK_ROOT/ltp || die "no $BENCHMARK_ROOT/ltp"

export PATH=/lkp/benchmarks/ltp/bin:$PATH

workaround_env

test_setting
is_excluded $test
log_cmd export LTP_RUNTIME_MUL=2
# use "-f $test" to run the user defined list of test suite, for example, test: syscalls
# use "-s $testcase" to run the specified testcase in test suite, for example, testcase: memfd_create03
testcase_opt=()
if [ -n "$testcase" ];then
	testcase_opt=(-s "$testcase")
fi
log_cmd ./runltp -f $test "${testcase_opt[@]}" $big_dev_opt $tmpdir_opt

cleanup_ltp

upload_files -t results $BENCHMARK_ROOT/ltp/results/* $BENCHMARK_ROOT/ltp/output
